﻿Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data
Imports System.Data.SqlClient
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.General

Namespace DoAnQuanLyBanHang.DTO
    Public Class NhomNguoiDungData
        Private m_NguoiDung As New DataService()

        Public Function LayNguoiDung() As DataTable
            Dim cmd As New SqlCommand("SELECT * FROM Nhom_Nguoi_Dung")
            m_NguoiDung.Load(cmd)
            Return m_NguoiDung
        End Function

        Public Function ThemDongMoi() As DataRow
            Return m_NguoiDung.NewRow()
        End Function

        Public Sub ThemNguoiDung(m_Row As DataRow)
            m_NguoiDung.Rows.Add(m_Row)
        End Sub

        Public Function LuuNguoiDung() As Boolean
            Return m_NguoiDung.ExecuteNoneQuery() > 0
        End Function

    End Class
End Namespace
